package com.houspace.utils;

import java.io.InputStream;

/**
 * Created by houxr on 17/04/11.
 */
public class HttpStreamResponse implements AutoCloseable{
    final String contentType;
    final long contentLength;
    final InputStream is;

    public HttpStreamResponse(String contentType, long contentLength, InputStream is) {
        this.contentType = contentType;
        this.contentLength = contentLength;
        this.is = is;
    }

    public String getContentType() {
        return contentType;
    }

    public long getContentLength() {
        return contentLength;
    }

    public InputStream getInputStream() {
        return is;
    }

    @Override
    public void close() throws Exception {
        if(is != null){
            is.close();
        }
    }
}